<template>
	<view>
		<view style="margin: 22rpx; border-radius: 16rpx;">
			<uni-table border stripe emptyText="暂无更多数据">
				<!-- 表头行 -->
				<uni-tr>
					<uni-th align="center">序号</uni-th>
					<uni-th align="center">托管时间</uni-th>
				</uni-tr>
				<!-- 表格数据行 -->
				<uni-tr v-for="(item, index) in list" :key="index">
					<uni-td align="center">{{ index + 1 }}</uni-td>
					<uni-td align="center">{{ item.depositStartDate | filterNull }}~{{ item.depositEndDate | filterNull }}</uni-td>
				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
import * as carOwnerApi from '@/api/carOwner-api.js';
export default {
	data() {
		return {
			carId: '',
			list: []
		};
	},
	onLoad(op) {
		this.carId = op.carId;
		this.getList();
	},
	methods: {
		getList() {
			carOwnerApi.getDepositRecord(this.carId).then(res => {
				this.list = res.data;
			});
		}
	}
};
</script>

<style lang="scss" scoped></style>
